
<!DOCTYPE html>
<!-- saved from url=(0021)http://www.zhihu.com/ -->
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>首页 - 所有问所有</title>

<meta name="description" content="一个真实的网络问答社区，帮助你寻找答案，分享知识。">
<link rel="stylesheet" href="/public/css/index.css" type="text/css" media="screen,print">
<script type="text/javascript" src="/public/js/jquery.js" charset="utf-8"></script>
<style>
.event_thinkers{display:block;}
#xyy-close{display:none;position:absolute;top:0;right:0;background:url("/public/img/proj/nba/x.png") no-repeat 50% 50%;width:25px;height:25px;}
#xyy-close:hover{background:url("/public/img/proj/nba/x2.png") no-repeat 50% 50%;text-decoration:none}
#xyy{display:block;position:relative;margin: 0 0 5px;}
#xyy:hover{cursor:pointer}
#xyy:hover #xyy-close{display:block !important}
.xpo + .xpo {
border-top: 1px solid #e9e9e9;
}
.xcjw{border-top:solid 1px #ccc !important}

.origin_image,.content_image{display:none}
</style>

<style>.editable img,.xn,.origin_image,.content_image{display:block}</style></head>
<body>
{% include 'header.html' %}
<div class="xnp" id="xpaw" style="display:none">
<div class="xf">
<div class="xrp">
<a class="xmq" href="javascript:;" title="关闭" name="close">x</a>
<span class="xpp"></span>
<span class="xoaw"></span>
</div>
</div>
</div>
<!--[if lte IE 6]>
<div id="xq">你正在使用的浏览器版本太低，将不能正常浏览本站及使用知乎的所有功能。请升级 <a href="http://windows.microsoft.com/zh-CN/internet-explorer/downloads/ie">Internet Explorer</a> 或使用 <a href="http://www.google.com/chrome/">Google Chrome</a> 浏览器。</div>
<![endif]-->


<div class="xf xcp">
<div class="xbp">
<div class="xap">

<div id="xfow" class="xfow xwv xe" style="display:block;">
<a href="javascript:$('#xfow').hide();" data-tip="s$b$不再提示" class="x-m"></a>
<h2>欢迎来到知乎！</h2>
<p class="first-line">知乎是一个基于真实身份的社区，来进一步 <strong><a class="xhv" href="http://www.zhihu.com/people/edit">完善你的个人资料</a></strong> 吧，让更多杰出的人认识你！</p>
<p>你可以逛逛 <strong><a class="xhv" href="http://www.zhihu.com/class">知乎领域</a></strong> / 使用 <strong><a class="xhv" href="http://www.zhihu.com/read">知乎阅读</a></strong> / 看看 <strong><a class="xhv" href="http://www.zhihu.com/question/19581624">知乎指南</a></strong></p>
</div>
<div class="xc" style="display: none; " id="xlp">
<a href="http://www.zhihu.com/settings/notify" class="xmv xvv"><span class="xzq"></span>通知设置</a>
<h3>新通知</h3>
<hr class="xfp">
<ul class="xep"><li class="xip">加载中...</li></ul>
<div>
<a class="xow xew xvv" href="http://www.zhihu.com/notifications">查看所有</a>
<a class="xmw xew" id="xjaw" href="javascript:;">知道了</a>
</div>
</div>
<div class="xu" id="xvp">
最新动态
</div>
<div class="xeo" id="xejw">
<a href="javascript:;" class="xaq" id="xdjw" style="display:none;">aaa</a>
{% try %}
{% for question in questions %}
<div class="xpo xmn" id="{{question.cid}}" data-qid="{{question.id}}">
<a data-tip="p$t${{question.name}}" href="http://www.zhihu.com/people/{{question.name}}" class="xbo">
<img class="xrn" src="/public/img/default.jpg" title="{{question.name}}">
</a>
<h2 class="xon"><a href="/question/{{question.id}}">{{question.title}}</a> </h2>
<div class="xqp">

{% for agree_user in question.agree_user %}
<a data-tip="p$t${{agree_user.name}}" href="/people/xu-zhou">{{agree_user.name}}</a> 回答了该问题
{% end %}

<span class="xlv">•</span> {{question.cnt_answer}} 个答案


<span class="xlv">•</span> 
{% if question.follow == -1 %}
<a href="javascript:;" id="feedfb-{{question.id}}" name="focus" class="xhv xtnw">关注</a>
{% else %}
<a href="javascript:;" id="feedfb-{{question.id}}" name="focus" class="xhv xfw">取消关注</a>
{% end %}
<span class="xlv">•</span> 
<a href="javascript:;" name="ignore" class="xhv" data-tip="s$b$不再在首页显示" data-pos="bottom">不感兴趣</a>

<span class="xjn">
<span class="xlv">•</span> <a href="javascript:;" name="collapse" class="xaw">收起答案</a>
</span>

</div>
{% if question.best > 0 %}
<div class="xco " 
    data-aid="{{question.answer.id}}" 
    data-atoken="14758605" 
    data-score="8.13015" 
    data-collapsed="0" 
    data-isowner="0" 
    data-isfriend="1" 
    data-created="{{question.answer.tm_add}}" 
    data-deleted="0">

{% if question.answer.status == 1 %}
<div class="xao xfn">
<a name="voteup" href="javascript:;" class="xhn" data-tip="取消赞同">+</a>
<a name="votedown" href="javascript:;" class="xgn" data-tip="反对，不会显示你的姓名">-</a>
</div>
{% elif question.answer.status == -1 %}
<div class="xao xen">
<a name="voteup" href="javascript:;" class="xhn" data-tip="赞同">+</a>
<a name="votedown" href="javascript:;" class="xgn" data-tip="取消反对">-</a>
</div>
{% else %}
<div class="xao ">
<a name="voteup" href="javascript:;" class="xhn" data-tip="赞同">+</a>
<a name="votedown" href="javascript:;" class="xgn" data-tip="反对，不会显示你的姓名">-</a>
</div>
{% end %}
<div class="xnn">
<a name="vote-num" class="xzo" href="javascript:;" data-votecount="{{question.answer.cnt_agree}}">{{question.answer.cnt_agree}}</a>
</div>

<div class="xin">

<div class="xylw">
<h3 class="xzn">
<a data-tip="p$t$xu-zhou" class="xbo" href="http://www.zhihu.com/people/{{question.answer.name}}">
<img src="/public/files/2774d4b90_s.jpg" class="xvo" data-source="http://p1.zhimg.com/27/74/2774d4b90_s.jpg">

</a>
<a data-tip="p$t${{question.answer.name}}" href="http://www.zhihu.com/people/xu-zhou">{{question.answer.name}}</a>，<strong title="question.answer.user_describe" class="xwkw">question.answer.user_describe</strong>
</h3>
</div>


<div class="xcn">
{%if question.answer.cnt_agree > 0%}
{{question.answer.cnt_agree}} 票，来自
<span class="xdhw">
{% for vote in question.answer.votes %}
<a data-tip="p$t$gaozongwen" href="/people/vote.url" class="xsv" title="{{vote.name}}" 
    data-authorid="b1f37475c5b1f7a723cdb8af4ceef49d">{{vote.name}}</a>、
{% end %}

{%if question.answer.cnt_agree > 3%}
<a href="javascript:;" name="showvoters" class="xsv xchw"> 更多 </a>
{% end %}
</span>
{% end %}
</div>


<div class="xbn" data-resourceid="309332" data-action="/answer/content">
<div class="xxkw xof">{{question.answer.content}}</div>
</div><div class="xdn">
<div class="xxkw xof">{{question.answer.content}}</div>
<a href="javascript:;" class="xzlw xts" name="complex">显示全部 »</a>
</div>

<div class="xqp xoj xgf">
<a class="xsv" data-gaq="feed|click_answer_link|feed_answer" href="/question/{{question.id}}/answer/{{question.answer.id}}">{{question.answer.time}}</a>
<span class="xlv">·</span>
<a href="javascript:;" name="addcomment" class="xsv xukw xdf">
<span class="xcf xbf"></span>{{question.answer.cnt_comment}} 条评论</a>
<a href="javascript:;" data-gaq="feed|share_answer|feed_answer" class="xy xsw xsv xdf" name="share"><span class="xcf xwe"></span>分享</a>



{% if question.answer.thank == 1%}
<a href="javascript:;"
class="xy xsw xsv xdf xef"
name="">
<span class="xcf xaf"></span>已感谢</a>
{% else%}
<a href="javascript:;"
class="xy xsw xsv xdf"
name="thanks">
<span class="xcf xaf"></span>感谢</a>
{% end %}



<a href="javascript:;" class=" xy xsw xsv xdf zu-question-answer-meta-fav" name="favo">
<span class="xcf xyf"></span>收藏</a>

<a href="javascript:;" class="xy xsw xsv xdf" name="nohelp">
{% if question.answer.nohelp == 1%}
<span class="xcf xxe"></span>取消没有帮助</a>
{% else %}
<span class="xcf xxe"></span>没有帮助</a>
{% end %}



<span class="xlv xsw">·</span>

<a href="javascript:;" class="xsw">

<b class="copy_icon_1"></b><b class="copy_icon_2"></b><b class="copy_icon_3"></b>


</a>

</div>

</div>
</div>
{% end %}

</div>
{% end %}
{% except %}
{% end %}

</div>
<a href="javascript:;" id="xpnw" class="xmw xd xkq">更多</a>
</div>
</div>

{% include 'right.html' %}

<div class="xe"></div>
</div>
{% include 'button.html' %}
<script type="text/javascript">
<!--
var max_id = {{max_id}};
var ex_max_id = {{max_id}};
var min_id = {{min_id}}
var count = 0;

function get_dynamic_num()
{
	$.ajax({
		  type: "GET",
		  url: "/get_dynamic_num",
		  data: "id="+max_id,
		  success: function(msg){
			try{	
				 var arr = eval(msg);
				 if (arr.length == 2)
				 {
					 max_id = arr[1];
					 count += arr[0];
					 $('#xdjw').html(count+'条新动态');
					 $('#xdjw').show();
				 }
			 }catch(e){}
		     get_dynamic_num();
		   },
		 error: function ()
		 {
		 	setTimeout("get_dynamic_num()", 3000);
		 }
		}); 
}

get_dynamic_num();

$('#xdjw').bind('click', function ()
{
	$(this).hide();
	$.ajax({
		  type: "GET",
		  url: "/dynamic",
		  data: "id="+ex_max_id,
		  success: function(msg){
			try{	
				 var arr = eval(msg);
				 if (arr.length == 2 && arr[1] != '')
				 {
					 ex_max_id = arr[0];
					 $('#xejw div:first').before(arr[1]);
					 count = 0;
				 }
			 }catch(e){}
		   }
		}); 
});

var max_height = $(document).height();
var w_height = document.documentElement.clientHeight;
var last_flag = true;
$(document).scroll(function ()
{
	if (last_flag && ($(document).scrollTop() + w_height) > $('#xpnw').offset().top)
	{
		last_flag = false;
		$('#xpnw').html('加载中...');
		setTimeout(function () {
			$.ajax({
			  type: "GET",
			  url: "/last",
			  data: "id="+min_id,
			  success: function(msg){
				try{	
					 var arr = eval(msg);
					 if (arr.length == 2)
					 {
						if (arr[1] != '')
						{
						 min_id = arr[0];
						 $('#xejw div:last').after(arr[1]);
						}
						else
						{
							$('#xpnw').html('无更多信息');
							return;
						}
					 }
				 }catch(e){}
				 last_flag = true;
				 $('#xpnw').html('更多');
			   },
			   error: function()
			   {
					last_flag = true;
					$('#xpnw').html('更多');
			   }
			}); 
		}, 1000);
	}
});


$("a[name='focus']").bind('click', function()
{
    var status = -1;
    if ($(this).text() == "关注")
    {
        $(this).removeClass("xtnw")
        $(this).addClass("xfw")
        $(this).text("取消关注")
        status = 1
    }
    else
    {
        $(this).removeClass("xfw")
        $(this).addClass("xtnw")
        $(this).text("关注")
    }
    
    var id = $(this).attr("id").substring(7)
    $.ajax({
    		  type: "POST",
    		  url: "/question/follow",
    		  data: {"question_id":id, "status":status},
    		  success: function(msg){
    		     
    		   }
    		}); 
});

$("a[name='ignore']").bind('click', function()
{
    $(this).parent().parent().hide()
    var id = $(this).attr("id").substring(7)
    alert(id)
});

$(".xzo").bind('click', function()
{
    $(this).parent().parent().parent().removeClass("xmn")
});


function vote_hover() 
{
    if (event.type == "mouseover")
    {
        $("#xlk").text($(this).attr("data-tip"))
        var p = $(this).offset()
        $('#xkk').css({left:p.left + $(this).width() + 4, top:p.top - 5, visibility:"", display: ""})
    }    
    else
    {
        $('#xkk').css({visibility:" hidden", display: " none"})
    }
};

function vote_click(event)
{
    $('#xkk').css({visibility:" hidden", display: " none"})
    var obj = $(this).parent()
    if (event.data.v == 1)
    {
        if (obj.hasClass('xfn'))
        {
            obj.removeClass('xfn')
            obj.children('.xhn').attr({'data-tip':"赞同"})
        }
        else if (obj.hasClass('xen'))
        {
            obj.removeClass('xen')
            obj.addClass('xfn')
            obj.children('.xhn').attr({'data-tip':"取消赞同"})
            obj.children('.xgn').attr({'data-tip':"反对，不会显示你的姓名"})
        }
        else
        {
            obj.addClass('xfn')
            obj.children('.xhn').attr({'data-tip':"取消赞同"})
        }
    }
    else
    {
        if (obj.hasClass('xen'))
        {
            obj.removeClass('xen')
            obj.children('.xgn').attr({'data-tip':"反对，不会显示你的姓名"})
        }
        else if (obj.hasClass('xfn'))
        {
            obj.removeClass('xfn')
            obj.addClass('xen')
            obj.children('.xhn').attr({'data-tip':"赞同"})
            obj.children('.xgn').attr({'data-tip':"取消反对"})
        }
        else
        {
            obj.addClass('xen')
            obj.children('.xgn').attr({'data-tip':"取消反对"})
        }
    }
    
    var aid = $(this).parent().parent().attr("data-aid")
    
    $.ajax({
		  type: "POST",
		  url: "/answer/vote",
		  data: {"aid":aid, "v":event.data.v},
		  success: function(msg){
		    tmp = obj.nextAll('.xin').children('.xcn')
		    tmp.empty()
		    tmp.append(msg)
		   }
		});
	 
};

$('.xhn').bind('hover',vote_hover, vote_hover);
$('.xhn').bind('click', {v:"1"}, vote_click);
$('.xgn').bind('hover',vote_hover, vote_hover);
$('.xgn').bind('click', {v:"-1"}, vote_click);


$('.xdf').bind('click', function()
{
    var name = $(this).attr("name")
    if (name == "thanks")
    {
        $(this).addClass("xef")
        $(this).attr("name", "")
        $(this).html("<span class=\"xcf xaf\"></span>已感谢")
    }
    else if (name == "nohelp")
    {
        if($(this).text().indexOf("取消没有帮助") >= 0)
        {
            name = "help"
            $(this).html("<span class=\"xcf xxe\"></span>没有帮助")
        }
        else
        {
            name = "nohelp"
            $(this).html("<span class=\"xcf xxe\"></span>取消没有帮助")
        }
    }
    
    var aid = $(this).parent().parent().parent().attr("data-aid")
    $.ajax({
		  type: "POST",
		  url: "/answer/"+name,
		  data: {"aid":aid},
		  success: function(msg){
		    
		   }
		});
});

-->
</script>
</body>
</html>